***** OPEN OUTPUT LOG FILE  *****

log using "C:\Users\hongj\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Administrative Inequality Bias (Paper #1)\Data Replication File Materials (JPART)\Output\Administrative Bias.MANUSCRIPT.02-01-2026.smcl", replace 



**** MANUSCRIPT STATISTICAL ANALYSES [JULY 7, 2025] ****


* MODELS 1 & 3 BASED ON FULL SAMPLE OF OBSERVATIONS *


* MODELS 2 & 4 BASED ON RESTRICTED SAMPLE OF OBSERVATIONS -- OMITTING OBSERVATIONS CONTAINED IN BASELINE NON-GUBERNATORIAL APPOINTMENT AUTHORITY CATEGORY [APPROVAL, BUT NO DIRECT GUBERNATORIAL APPOINTMENT AUTHORITY (N = 42) & NON-PARTISAN GOVERNOR OBSERVATIONS (N = 5)




*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************

*** Retrieve UPDATED Statistical Database with "NEW VARIBALES" Incorporated as of 07-04-2025 *** 

use "C:\Users\hongj\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Administrative Inequality Bias (Paper #1)\Data Replication File Materials (JPART)\Data\Admin_Bias.MASTER DATABASE.07-04-2025.dta", clear







*** SET DATA TO PANEL STRUCTURE  ***

xtset state_numident year, yearly

*
*
*



* Compute Natural Logarithm of Dependent Variable [Benefit Overpayment Error Detection -- in 2010 Constant Dollars] for ancillary bivariate correlations with 'levels' measure *


* NOTE: "SAI" refers to State Agency Initiated Detection of Benefit Overpayment Errors -- which comprise, on mean average, 98.6% of all such cases & 97.4% median average of total amounts detected for all such cases (the remaining 1.4% & 2.6% are captured by BAM sample estimates)  

gen ln_sai_detamt_clmtreal = ln(sai_detamt_clmtreal + 1)


** GENERATE ADDITIONAL 'SCALE' EFFECT CONTROL MEASURES BASED ON BAM QUALITY CONTROL SURVEY SAMPLING ESTIMATES OF TOTAL ADMINISTRATIVE ERRORS BY STATE AGENCY IN A GIVEN YEAR & TOTAL EMPLOYER APPEALS OF CLAIMANT BENEFITS **

gen ln_clmterror_est = ln(clmterror_est + 1)

gen ln_employerappeals_ct = ln(employerappeals_ct + 1)



drop if missing(clmterror_est)
*
drop if missing(employerappeals_ct)


*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************




* DATA AND EMPIRICAL STRATEGY IN MANUSCRIPT:

*** DESCRIPTIVE STATISTICS FOR DEPENDENT VARIABLES EMPLOYED IN THIS STUDY: CLAIMANT OVERPAYMENTS [IN CONSTANT 2010 DOLLARS]: BOTH FULL SAMPLE AND THOSE OMITTING NON-PARTISAN GUBERNATORIAL APPROVAL APPOINTMENT AUTHORITY [SEE DESCRIPTION ABOVE ON LINE [IN CONSTANT 2010 DOLLARS] ***

sum  sai_detamt_clmtreal, detail
*
sum  sai_detamt_clmtreal if nonpartisan_gubapprove!=1, detail
*
*
*
*

** DESCRIPTIVE STATISTICS AND BIVARIATE CORRELATION BETWEEN 'SAI' OUTCOME/DEPENDENT VARIABLE MEASURE AND 'TOTAL' VERSION OF THIS MEASURE **

sum sai_detamt_clmtreal detamt_clmtreal, detail
*
correlate sai_detamt_clmtreal detamt_clmtreal
correlate sai_detamt_clmtreal detamt_clmtreal if nonpartisan_gubapprove!=1
*
*

* Percentage & Difference Calculations Between Median 'SAI'  & ' Total' Outcome Measures [Full Sample] * 

display (3787030/3886146)*100
*
display (3886146 - 3787030)/3886146





*** FOOTNOTE 13: NEED TO EMPLOY LOGNORMAL REGRESSION SINCE CORRELATION WITH LOGGED TRANSFORMED DATA IS NOT STRONGLY CORRELATED [also log-normal better for heavily right-skewed data than gamma] ***

correlate ln_sai_detamt_clmtreal sai_detamt_clmtreal
* 
correlate ln_sai_detamt_clmtreal sai_detamt_clmtreal if nonpartisan_gubapprove!=1





*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************




*** COMPUTE WITHIN-STATE DESCRIPTIVE STATISTICS SINCE MODEL ESTIMATES ARE WITHIN-STATE EFFECTS [FULL MODEL OF OBSERVATIONS] *** 

** compute within-state descriptive statistics for outcome variables [detamt_clmtreal & detamt_empreal] [FULL AND RESTRICTED SAMPLES] *

* calculate the state group-means *

egen b_sai_detamt_clmtreal = mean(sai_detamt_clmtreal), by(state_numident)
*
egen b_sai_detamt_clmtreal_omit = mean(sai_detamt_clmtreal) if nonpartisan_gubapprove!=1, by(state_numident)
*
*
*

* compute the within-state deviations from the respective state group means [FULL AND RESTRICTED SAMPLES] *

gen w_sai_detamt_clmtreal = sai_detamt_clmtreal - b_sai_detamt_clmtreal
*
gen w_sai_detamt_clmtreal_omit = sai_detamt_clmtreal - b_sai_detamt_clmtreal_omit if nonpartisan_gubapprove!=1
*
*
*


* compute descriptive statistics & correlations for overall measure and within-state measures for each dependent variable [FULL AND RESTRICTED SAMPLES] *
 
sum sai_detamt_clmtreal  w_sai_detamt_clmtreal, detail
correlate sai_detamt_clmtreal  w_sai_detamt_clmtreal
*
*
sum sai_detamt_clmtreal  w_sai_detamt_clmtreal_omit if nonpartisan_gubapprove!=1, detail
correlate sai_detamt_clmtreal  w_sai_detamt_clmtreal_omit if nonpartisan_gubapprove!=1
*
*
*



*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************




* compute interquartile range difference (change from 25th percentile values to 75th percentile values) for above within-state measures [FULL SAMPLE] *

* w_sai_detamt_clmtreal_0.25 -->  w_sai_detamt_clmtreal_0.75 = $3,017,598 
display 590808 -  -2426790



* compute interquartile range difference (change from 25th percentile values to 75th percentile values) for above within-state measures [RESTRICTED SAMPLE] *

*w_sai_detamt_clmtreal_omit_0.25 -->  w_sai_detamt_clmtreal_omit_0.75 = $3,173,463.5
display  590394.5 - -2583069 




*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************






*** COMPUTE WITHIN-STATE DESCRIPTIVE STATISTICS SINCE MODEL ESTIMATES ARE WITHIN-STATE EFFECTS [DIRECT GUBERNATORIAL APPOINTMENT REGIME SUBSAMPLE] *** 



* compute descriptive statistics & correlations for overall measure and within-state measures for each dependent variable [DIRECT GUBERNATORIAL APPOINTMENT REGIME SUBSAMPLE] *
 
sum sai_detamt_clmtreal w_sai_detamt_clmtreal w_sai_detamt_clmtreal_omit if gubapptauth_partisan_rescaled4==1, detail

* Set Global Macro of IQR
sum w_sai_detamt_clmtreal if gubapptauth_partisan_rescaled4==1, detail
global amtiqr_m1m3_rescaled4_1 = round(r(p75),1)-round(r(p25),1)
di $amtiqr_m1m3_rescaled4_1

sum w_sai_detamt_clmtreal_omit if gubapptauth_partisan_rescaled4==1, detail
global amtiqr_m2m4_rescaled4_1 = round(r(p75),1)-round(r(p25),1)
di $amtiqr_m2m4_rescaled4_1
*
*
*
*
*


* compute interquartile range difference (change from 25th percentile values to 75th percentile values) for above within-state measures [DIRECT GUBERNATORIAL APPOINTMENT REGIME SUBSAMPLE] *

* w_sai_detamt_clmtreal_0.25 -->  w_sai_detamt_clmtreal_0.75 = $3,272,651.2 [Full Model of Observations] * 
di $amtiqr_m1m3_rescaled4_1
display 614364.2 - -2658287 
*
*
* w_sai_detamt_clmtreal_omit_0.25 -->  w_sai_detamt_clmtreal_omit_0.75 = $3,222,368.3 [Restricted Model of Observations] *  
di $amtiqr_m2m4_rescaled4_1
display   614751.3  -  -2607617






**** 0. Generate Descriptive Statistics Table [full sample of observations]
cd "C:\Users\hongj\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Administrative Inequality Bias (Paper #1)\JPART R&R\Statistics\Output Files"

estpost summarize sai_detamt_clmtreal  gubapptauth_partisan_rescaled4  gubapptauth_partisan_rescaled3   electionyear econideol_median  publicunion_cov  unemp_rate  ln_uiadmin_budget_real ln_pop_size ln_emp_contributions ln_clmterror_est ln_employerappeals_ct if !missing(clmterror_est)

esttab using TableA2.02-01-2026.rtf, cells("count mean sd min max") noobs replace



************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************





* Generate Per Case Variable 


egen b_sai_detct_clmt = mean(sai_detct_clmt), by(state_numident)
gen w_sai_detct_clmt = sai_detct_clmt - b_sai_detct_clmt

sum sai_detct_clmt w_sai_detct_clmt, detail


gen sai_clmterror_percase=sai_detamt_clmtreal/sai_detct_clmt
sum sai_clmterror_percase, detail



*
*
egen b_sai_detct_clmt_omit = mean(sai_detct_clmt) if nonpartisan_gubapprove!=1, by(state_numident)
gen w_sai_detct_clmt_omit = sai_detct_clmt - b_sai_detct_clmt_omit

* Compute interquartile range difference for within-state claimant error detection total counts [Full Sample]
sum w_sai_detct_clmt if gubapptauth_partisan_rescaled4==1, detail

global ctiqr_m1m3_rescaled4_1 = round(r(p75)-r(p25),1)
di $ctiqr_m1m3_rescaled4_1
di round(r(p75)-r(p25), 0.01)
* = 4,277.50

* Compute interquartile range difference for within-state claimant error detection total counts [Restricted Sample]
sum w_sai_detct_clmt_omit if gubapptauth_partisan_rescaled4==1 & nonpartisan_gubapprove!=1, detail

global ctiqr_m2m4_rescaled4_1 = round(r(p75)-r(p25),1)
di $ctiqr_m2m4_rescaled4_1
di round(r(p75)-r(p25), 1)
* = 4,309.9
*
*
* Compute interquartile range difference for within-state claimant error detection total counts [Full Sample]
sum w_sai_detct_clmt if gubapptauth_partisan_rescaled3==1, detail

global ctiqr_m1m3_rescaled3_1 = round(r(p75)-r(p25), 1)
di $ctiqr_m1m3_rescaled3_1
di round(r(p75)-r(p25), 0.01)
* = 5,163.35

sum w_sai_detct_clmt if gubapptauth_partisan_rescaled3==2, detail

global ctiqr_m1m3_rescaled3_2 = round(r(p75)-r(p25), 1)
di $ctiqr_m1m3_rescaled3_2
di round(r(p75)-r(p25), 0.01)
* = 3,942.65

sum w_sai_detct_clmt if gubapptauth_partisan_rescaled3==1|gubapptauth_partisan_rescaled3==2, detail

global ctiqr_m1m3_rescaled3_1or2 = round(r(p75)-r(p25), 1)
di $ctiqr_m1m3_rescaled3_1or2
di round(r(p75)-r(p25),  1)
* = 4,277.5





* Compute interquartile range difference for within-state claimant error detection total counts [Restricted Sample]
sum w_sai_detct_clmt_omit if gubapptauth_partisan_rescaled3==1 & nonpartisan_gubapprove!=1, detail

global ctiqr_m2m4_rescaled3_1 = round(r(p75)-r(p25), 1)
di $ctiqr_m2m4_rescaled3_1
di round(r(p75)-r(p25),  1)
* = 5,163.35

sum w_sai_detct_clmt_omit if gubapptauth_partisan_rescaled3==2 & nonpartisan_gubapprove!=1, detail

global ctiqr_m2m4_rescaled3_2 = round(r(p75)-r(p25), 1)
di $ctiqr_m2m4_rescaled3_2
di round(r(p75)-r(p25),  1)
* = 4,008.03

sum w_sai_detct_clmt_omit if gubapptauth_partisan_rescaled3==1 & nonpartisan_gubapprove!=1|gubapptauth_partisan_rescaled3==2 & nonpartisan_gubapprove!=1, detail

global ctiqr_m2m4_rescaled3_1or2 = round(r(p75)-r(p25), 1)
di $ctiqr_m2m4_rescaled3_1or2
di round(r(p75)-r(p25),  1)
* =4,309.9





**** POLITICAL INEQUALITY BIAS IN ADMINISTRATIVE ERROR DETECTION TARGETING CLAIMANT OVERPAYMENTS: DISTINCTIONS BETWEEN NON-PARTISAN AND PARTISAN DIRECT GUBERNATORIAL APPOINTMENT AUTHORITY  **** 







*** SAVE UPDATED STATISTICAL DATABASE WITH VARIBALES INCORPORATED FROM ABOVE PROGRAM CODE as of 07-05-2025 [THIS DATABASE IS USED IN APPENDIX STATISTICAL ANALYSES] *** 


save "C:\Users\hongj\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Administrative Inequality Bias (Paper #1)\Data Replication File Materials (JPART)\Data\Admin_Bias.MANUSCRIPT DATABASE.07-07-2025.dta", replace










*** NOTE: PERFORM PAIRWISE REGRESSIONS ON SAME GUBERNATORIAL APPOINTMENT AUTHORITY MEASURE BETWEEN "DETAMT_CLMTREAL" DEPENDENT VARIABLES [FULL SAMPLE OF OBSERVATIONS &  RESTRICTED SAMPLE OF OBSERVATIONS OMIT OBSERVATIONS CONTAINED IN BASELINE NON-GUBERNATORIAL APPOINTMENT AUTHORITY CATEGORY [APPROVAL, BUT NO DIRECT GUBERNATORIAL APPOINTMENT AUTHORITY (N = 42) & NON-PARTISAN GOVERNOR OBSERVATIONS (N = 5)] [I.E., MODELS 1 & 2 / MODELS 3 & 4] ***








*** MODELS 1 & 2:BENEFIT OVERPAYMENT ERROR DETECTION BY STATE UIP AGENCY-INITIATION [CLAIMANT-/NON-FRAUD] -- AMOUNTS IN 2010 CONSTANT-DOLLAR TERMS --- DISTINCTIONS BETWEEN GUBERNATORIAL APPOINTMENT AUTHORITY: NON-PARTISAN DISTINCTION *  



*** NON-PARTISAN BASELINE MODELS [MODELS 1 & 2]: DISTINCTION BETWEEN GUBERNATORIAL DIRECT APPOINTMENT POWERS VERSUS ABSENCE OF SUCH INSTITUTIONAL POWERS [BINARY INDICATOR MEASURE] ***
*** gubapptauth_partisan_rescaled4==0 [ABSENCE OF DIRECT GUBERNATORIAL APPOINTMENT POWERS] &  gubapptauth_partisan_rescaled4==1 [DIRECT GUBERNATORIAL APPOINTMENT POWERS] ***





*** ESTIMATION OF MODELS 1 & 2 *** 


** MODEL 1 **

glm  sai_detamt_clmtreal i.gubapptauth_partisan_rescaled4  electionyear econideol_median  publicunion_cov  unemp_rate  ln_uiadmin_budget_real ln_pop_size  ln_clmterror_est ln_employerappeals_ct    i.state_numident i.year,  family(normal) link(log) vce(cluster state_numident)
*
estat ic
*
*
estimate store m1
gen byte esample_m1 = 1 if e(sample)
*
*
*


** MODEL 2 **

glm  sai_detamt_clmtreal  i.gubapptauth_partisan_rescaled4  electionyear    econideol_median  publicunion_cov  unemp_rate  ln_uiadmin_budget_real ln_pop_size  ln_clmterror_est  ln_employerappeals_ct  i.state_numident i.year if nonpartisan_gubapprove!=1,  family(normal) link(log) vce(cluster state_numident)
*
estat ic
*
*
estimate store m2
gen byte esample_m2 = 1 if e(sample)

*
*
*

estimates dir




***** WITHIN-OVERPAYMENT ERROR DETECTION HYPOTHESES ******




** FIGURE 2 [TOP PORTION: GOV. DIRECT APPOINTMENT (BINARY)]: BASELINE UNCONDITIONAL APPOINTMENT MARGINAL EFFECTS [GOVERNOR'S HAVE DIRECT APPOINTMENT AUTHORITY: NO PARTISAN DISTINCTIONS] ** 

macro list _all

estimate restore m1
lincom 1.gubapptauth_partisan_rescaled4*$amtiqr_m1m3_rescaled4_1
matrix m1a = 1, 1, 1, r(estimate), r(lb), r(ub), r(p)
*
di round(r(estimate)/$ctiqr_m1m3_rescaled4_1, 0.01)
*
*
*
estimate restore m2
lincom 1.gubapptauth_partisan_rescaled4*$amtiqr_m2m4_rescaled4_1
matrix m1d = 2, 1, 2, r(estimate), r(lb), r(ub), r(p)
*
di round(r(estimate)/$ctiqr_m2m4_rescaled4_1, 0.01)

*
*
*
*
*
*
*


*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************



* compute descriptive statistics & correlations for overall measure and within-state measures for each dependent variable [broken down by each appointment regime] * 
 

* non-direct gubernatorial appointment regime [gubapptauth_partisan_rescaled3==0] * 
sum detamt_clmtreal  w_sai_detamt_clmtreal if gubapptauth_partisan_rescaled3==0, detail
correlate detamt_clmtreal  w_sai_detamt_clmtreal if gubapptauth_partisan_rescaled3==0
*
*
*
*

* compute interquartile range difference (change from 25th percentile values to 75th percentile values) for above within-state measures [FULL SAMPLE] * 


* w_sai_detamt_clmtreal_0.25 -->  w_sai_detamt_clmtreal_0.75 = $2,496,210.8
display 489020.8 - -2007190

*
*

* compute interquartile range difference (change from 25th percentile values to 75th percentile values) for above within-state measures [RESTRICTED SAMPLE] *  

* w_sai_detamt_clmtreal_omit_0.25 -->  w_sai_detamt_clmtreal_omit_0.75 = $2,934,238
display 453859 - -2480379





*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************


 
* Direct gubernatorial appointment regime [gubapptauth_partisan_rescaled3==1] * 
sum sai_detamt_clmtreal  w_sai_detamt_clmtreal  w_sai_detamt_clmtreal_omit if gubapptauth_partisan_rescaled3==1, detail
correlate sai_detamt_clmtreal  w_sai_detamt_clmtreal  if gubapptauth_partisan_rescaled3==1
*
*
*
* Set Global Macro of IQR
sum w_sai_detamt_clmtreal if gubapptauth_partisan_rescaled3==1, detail
global amtiqr_m1m3_rescaled3_1 = round(r(p75),1)-round(r(p25),1)
di $amtiqr_m1m3_rescaled3_1

sum w_sai_detamt_clmtreal_omit if gubapptauth_partisan_rescaled3==1, detail
global amtiqr_m2m4_rescaled3_1 = round(r(p75),1)-round(r(p25),1)
di $amtiqr_m2m4_rescaled3_1



* compute interquartile range difference (change from 25th percentile values to 75th percentile values) for above within-state measures * 

* w_sai_detamt_clmtreal_0.25 -->  w_sai_detamt_clmtreal_0.75 = $3,016,376.5
display 625595.5  - -2390781 

*

* compute interquartile range difference (change from 25th percentile values to 75th percentile values) for above within-state measures [RESTRICTED SAMPLE] *  

* w_sai_detamt_clmtreal_omit_0.25 -->  w_sai_detamt_clmtreal_omit_0.75 = $3,032,901.5
display  642120.5  - -2390781  




*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************



* Direct gubernatorial appointment regime [gubapptauth_partisan_rescaled3==2] * 
sum sai_detamt_clmtreal  w_sai_detamt_clmtreal w_sai_detamt_clmtreal_omit if gubapptauth_partisan_rescaled3==2, detail
correlate sai_detamt_clmtreal  w_sai_detamt_clmtreal if gubapptauth_partisan_rescaled3==2

*
*
*

* compute interquartile range difference (change from 25th percentile values to 75th percentile values) for above within-state measures *  

* Set Global Macro of IQR
sum w_sai_detamt_clmtreal if gubapptauth_partisan_rescaled3==2, detail
global amtiqr_m1m3_rescaled3_2 = round(r(p75),1)-round(r(p25),1)
di $amtiqr_m1m3_rescaled3_2

* w_sai_detamt_clmtreal_0.25 -->  w_sai_detamt_clmtreal_0.75 = $3,669,033.5 
display 581804.5 - -3087229

*
*
*

* compute interquartile range difference (change from 25th percentile values to 75th percentile values) for above within-state measures [RESTRICTED SAMPLE] * 

sum w_sai_detamt_clmtreal_omit if gubapptauth_partisan_rescaled3==2, detail
global amtiqr_m2m4_rescaled3_2 =  round(r(p75),1)-round(r(p25),1)
di $amtiqr_m2m4_rescaled3_2

* w_sai_detamt_clmtreal_omit_0.25 -->  w_sai_detamt_clmtreal_omit_0.75 = $3,670,541.6 
display 583312.6 - -3087229


*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************





*** MODELS 3 & 4: PARTISAN BASELINE MODELS -- DISTINCTION BETWEEN DEMOCRATIC AND REPUBLICAN GUBERNATORIAL DIRECT APPOINTMENT POWERS VERSUS ABSENCE OF SUCH INSTITUTIONAL POWERS [THREE GROUP CATEGORICAL MEASURE] ***


*** PARTISAN BASELINE MODELS: DISTINCTION BETWEEN DEMOCRATIC AND REPUBLICAN GUBERNATORIAL DIRECT APPOINTMENT POWERS VERSUS ABSENCE OF SUCH INSTITUTIONAL POWERS  [THREE GROUP CATEGORICAL MEASURE] ***
*** gubapptauth_partisan_rescaled3==0 [ABSENCE OF DIRECT GUBERNATORIAL APPOINTMENT POWERS] &  gubapptauth_partisan_rescaled3==1 [REPUBLICAN DIRECT GUBERNATORIAL APPOINTMENT POWERS: CONSTRAINED & UNCONSTRAINED COMBINED] & gubapptauth_partisan_rescaled3==2 [DEMOCRATIC DIRECT GUBERNATORIAL APPOINTMENT POWERS: CONSTRAINED & UNCONSTRAINED COMBINED] ***






*** ESTIMATION OF MODELS 3 & 4: BENEFIT OVERPAYMENT ERROR DETECTION BY STATE UIP AGENCY-INITIATION [CLAIMANT-/NON-FRAUD] -- AMOUNTS IN 2010 CONSTANT-DOLLAR TERMS  *** 


** MODEL 3 **

glm  sai_detamt_clmtreal i.gubapptauth_partisan_rescaled3  electionyear econideol_median  publicunion_cov  unemp_rate  ln_uiadmin_budget_real ln_pop_size  ln_clmterror_est  ln_employerappeals_ct   i.state_numident i.year,  family(normal) link(log) vce(cluster state_numident)
*
estat ic
*
*
estimate store m3
gen byte esample_m3 = 1 if e(sample)

*
*
*


** MODEL 4 **

glm  sai_detamt_clmtreal  i.gubapptauth_partisan_rescaled3  electionyear    econideol_median  publicunion_cov  unemp_rate  ln_uiadmin_budget_real ln_pop_size  ln_clmterror_est ln_employerappeals_ct  i.state_numident i.year if nonpartisan_gubapprove!=1,  family(normal) link(log) vce(cluster state_numident)
*
estat ic

*
estimate store m4
gen byte esample_m4 = 1 if e(sample)

*
*
*
*
*
*

estimates dir





***** WITHIN-OVERPAYMENT ERROR DETECTION ******


*** FIGURE 2 [MIDDLE PORTION: PARTISAN DISTINCTIONS]: UNCONDITIONAL MARGINAL PARTISAN GUBERNTORIAL APPOINTMENT EFFECTS [REPUBLICAN/DEMOCRATIC GOVERNORS WITH DIRECT APPOINTMENT AUTHORITY]: *** 
macro list _all

estimate restore m3
lincom 1.gubapptauth_partisan_rescaled3*$amtiqr_m1m3_rescaled3_1

matrix m3b1 = 4, 2, 1, r(estimate), r(lb), r(ub) , r(p)
*

di $ctiqr_m1m3_rescaled3_1
di r(estimate)/$ctiqr_m1m3_rescaled3_1
*
*
*
*
estimate restore m4
lincom 1.gubapptauth_partisan_rescaled3*$amtiqr_m2m4_rescaled3_1 

matrix m4b1 = 5, 2, 2, r(estimate), r(lb), r(ub) , r(p)
*
di $ctiqr_m2m4_rescaled3_1
di r(estimate)/$ctiqr_m2m4_rescaled3_1

*
*
*
*
*
*
estimate restore m3
lincom 2.gubapptauth_partisan_rescaled3*$amtiqr_m1m3_rescaled3_2
matrix m3b2 = 7, 3, 1, r(estimate), r(lb), r(ub) , r(p)
*
di $ctiqr_m1m3_rescaled3_2
di r(estimate)/$ctiqr_m1m3_rescaled3_2
*
*
*
estimate restore m4
lincom 2.gubapptauth_partisan_rescaled3*$amtiqr_m2m4_rescaled3_2 

matrix m4b2 = 8, 3, 2, r(estimate), r(lb), r(ub) , r(p)
*
di $ctiqr_m2m4_rescaled3_2
di r(estimate)/$ctiqr_m2m4_rescaled3_2
*


*
*
*
*

*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************

 
***  FIGURE 2 [BOTTOM PORTION: PARTISAN DISTINCTIONS] ANCILLARY WITHIN-OVERPAYMENT ERROR DETECTION HYPOTHESES [REPUBLICAN/DEMOCRATIC GOVERNORS WITH DIRECT APPOINTMENT AUTHORITY] ***  
*** 
 
estimate restore m3
lincom 1.gubapptauth_partisan_rescaled3*$amtiqr_m1m3_rescaled3_1   - (2.gubapptauth_partisan_rescaled3*$amtiqr_m1m3_rescaled3_2) 

matrix m3b1b2 = 10, 4, 1, r(estimate), r(lb), r(ub) , r(p)
*
di $ctiqr_m1m3_rescaled3_1or2
di r(estimate)/$ctiqr_m1m3_rescaled3_1or2

*
*
*
estimate restore m4
lincom 1.gubapptauth_partisan_rescaled3*$amtiqr_m2m4_rescaled3_1    - (2.gubapptauth_partisan_rescaled3*$amtiqr_m2m4_rescaled3_2)

matrix m4b1b2 = 11, 4, 2, r(estimate), r(lb), r(ub) , r(p)
*
di $ctiqr_m2m4_rescaled3_1or2
di r(estimate)/$ctiqr_m2m4_rescaled3_1or2

*

*************************************************************************************************************************************************************************************************************
********************************************************************************************************************************************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************

* ANCILLARY STATISTICS IN MANUSCRIPT

	* Footnote 3: 
	list year sai_detct_clmt ClaimantErrorDetection_Count if st_postal=="GA" 

	* Figure 1:
	tab apptmethod_1 govparty_num, cell

	* Footnote 13: 
	xtsum gubapptauth_partisan_rescaled4 if esample_m1 ==1
	xtsum gubapptauth_partisan_rescaled4 if esample_m2 ==1
	xtsum gubapptauth_partisan_rescaled4 if esample_m3 ==1
	xtsum gubapptauth_partisan_rescaled4 if esample_m4 ==1
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************

*
*
*
cd "C:\Users\hongj\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Administrative Inequality Bias (Paper #1)\JPART R&R\Statistics\Output Files"

esttab m1 m2 m3 m4 using ManuscriptTable1.02-01-2026.rtf, ///
cells(b(star fmt(%9.3f)) se(par) p(fmt(3) par("[" "]"))) starl( * 0.10 ** 0.05 *** 0.010) label ///
nonumbers mtitles("Model 1" "Model 2" "Model 3" "Model 4")  ///
stats(year qic pseudor chi2 N, fmt(2) label("Year Fixed Effects" "QIC" "Pseudo R-Squared" "Wald" "N")) append









**# PUTEXCEL: ESTIMATES FOR FIGURE 1 DEPENDENT VARIABLE CATEGORIES

tab gubapptauth_partisan_rescaled4 if !missing(clmterror_est), matcell(rescaled4)
tab gubapptauth_partisan_rescaled3 if !missing(clmterror_est), matcell(rescaled3)

matrix rescaled4a= rescaled4, rescaled4/10, (1\2)
matrix row3= ., ., 3
matrix rescaled3a= rescaled3, rescaled3/10, (4\5\6)

matrix fig1 = rescaled4a\row3\rescaled3a
matrix colnames fig1= freq proportion row

putexcel set "C:\Users\hongj\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Administrative Inequality Bias (Paper #1)\JPART R&R\Statistics\Graphics Files\Fig1.02-01-2026.xlsx", sheet("figure2") replace
putexcel A1= matrix(fig1), colnames 

**# PUTEXCEL: ESTIMATES FOR FIGURE 2
matrix row3= 3, ., ., ., ., ., .
matrix row6= 6, ., ., ., ., ., .
matrix row9= 9, ., ., ., ., ., .

matrix fig2 = m1a\ m1d\ row3 \ m3b1\ m4b1\ row6\ m3b2\m4b2\row9\ m3b1b2\m4b1b2

matrix colnames fig2= row partisan group estimates lb ub p-value
matrix list fig2

putexcel set "C:\Users\hongj\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Administrative Inequality Bias (Paper #1)\JPART R&R\Statistics\Graphics Files\Fig2.02-01-2026.xlsx", sheet("lincomresults") replace
putexcel A1= matrix(fig2), colnames 

*
*
*
*
*

*******************************************************************************
** Set Default Graphics Settings
set scheme stcolor, permanently
graph set svg fontface "Cambria Math"


*******************************************************************************
*******************************************************************************
*******************************************************************************
*******************************************************************************



**# Generate Graph "Figure 1"
import excel "C:\Users\hongj\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Administrative Inequality Bias (Paper #1)\JPART R&R\Statistics\Graphics Files\Fig1.02-01-2026.xlsx", firstrow clear

graph set window fontface "Cambria Math"
set scheme stcolor

twoway (bar proportion row,  yaxis(1) ysc(r(0 90)) ytitle("Proportion of Each Category (%)", margin(medium) size(medsmall)) ylabel(0 "0" 20 "20" 40 "40" 60 "60" 80 "80", labsize(small))) ///
(scatter freq row,  msymbol(none) yaxis(2)  ylabel(, axis(2) labsize(small)) ytitle("Counts", margin(medium) axis(2)) msymbol(none)), ///
text(19 1 "172 (17.2%)", place(n) size(small)) ///
text(84.6 2 "827 (82.8%)", place(n) size(small)) ///
text(19 4 "172 (17.2%)", place(n) size(small)) ///
text(44.4 5 "425 (42.6%)", place(n) size(small)) ///
text(42 6 "402 (40.2%)", place(n) size(small)) ///
xlabel(1 "Non-Gov Direct Appointment" 2 "Gov Direct Appointment" 4 "Non-Gov Direct Appointment" 5 "Republican Gov Direct Appointment" 6 "Democratic Gov Direct Appointment",  angle(40) noticks labsize(medsmall)) ///
title("{bf: Figure 1. Distribution of Appointment Authority}" "(Unemployment Insurance Agency Heads in the American States, 2002-2021)", size(medsmall) span margin(medsmall)) graphregion(margin(l+11 r)) xsize(7) legend(off) xtitle("")

graph save "C:\Users\hongj\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Administrative Inequality Bias (Paper #1)\JPART R&R\Statistics\Graphics Files\Fig1-02-01-2026", replace


*******************************************************************************
*******************************************************************************
*******************************************************************************
*******************************************************************************


**# Generate Graph "Figure 2"
import excel "C:\Users\hongj\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Administrative Inequality Bias (Paper #1)\JPART R&R\Statistics\Graphics Files\Fig2.02-01-2026.xlsx", firstrow clear

graph set window fontface "Cambria Math"
set scheme stcolor

twoway (rcap lb ub row, lpattern(solid) horizontal) ///
(scatter row estimates if partisan==1 & group==1, mcolor(black) msymbol(square) msize(small)) ///
(scatter row estimates if partisan==1 & group==2, mcolor(black) msymbol(square_hollow) msize(small) ) ///
(scatter row estimates  if partisan==2 & group==1, mcolor(red) msymbol(square) msize(small)) ///
(scatter row estimates  if partisan==2 & group==2, mcolor(red) msymbol(square_hollow) msize(small)) ///
(scatter row estimates if partisan==3 & group==1, mcolor(blue) msymbol(square) msize(small)) ///
(scatter row estimates if partisan==3 & group==2, mcolor(blue) msymbol(square_hollow) msize(small)) ///
(scatter row estimates if partisan==4 & group==1, mcolor(purple) msymbol(square) msize(small)) ///
(scatter row estimates if partisan==4 & group==2, mcolor(purple) msymbol(square_hollow) msize(small)) ///
, xline(0, lcolor(red) lpattern(shortdash))  ///
ylabel(1 "{bf: Gov. Direct Appointment (Binary)}"  3.3 `" "{bf: Partisan Distinctions}" "' 4.5 "Republican Gov. Direct Appointment" 7.5 "Democratic Gov. Direct Appointment" 10.5 `" "Republican - Democratic Gov." "Direct Appointment Difference" "' ///
,angle(0) labsize(medsmall) nogrid noticks) ///
legend(order(2 "Benefit Overpayment Error (Full Sample)" 3 "Benefit Overpayment Error (Restricted Sample)") pos(6) ring(2) cols(1) size(small))  ///
xlabel(-4000000 "-$4" -2000000 "-$2" 0 "$0" 2000000 "$2" 4000000 "$4", labsize(medium)) ///
yscale(reverse) graphregion(margin(l=3 r=5)) ysize(6) xsize(8.5)  ///
title(" {bf:Figure 2. Appointment Authority Effects on}" "{bf: Benefit Overpayment Error Detection}", size(medium) span) ///
subtitle("(Unemployment Insurance Agency Heads in the American States, 2002-2021)", size(medsmall) span margin(b+4)) ///
xtitle("Agency Initiated Benefit Overpayment Detection", size(medsmall) margin(medium)) ytitle("") ///
note("Note: Dollar Amounts Presented in 2010 Constant Million Dollars.", pos(7))


graph save "C:\Users\hongj\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Administrative Inequality Bias (Paper #1)\JPART R&R\Statistics\Graphics Files\Fig2-02-01-2026", replace



*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
*************************************************************************************************************************************************************************************************************
******************************************************************************
	
log close



